<template>
  <a-modal
    title="申请延期"
    width="750px"
    centered
    :visible="extensionVisible"
    :maskClosable="false"
    @cancel="close"
    :footer="null"
  >
    <a-form-model
      class="form approval-content"
      :model="form"
      v-bind="formLayout"
    >
      <a-form-model-item label="应答复日期">
        <span>{{ form.date }}</span>
      </a-form-model-item>
      <a-form-model-item label="延期时间">
        <a-date-picker v-model="form.extensionDate" style="width: 100%" />
      </a-form-model-item>
      <a-form-model-item label="短信提醒">
        <a-switch
          v-model="form.messageAlert"
          checked-children="开"
          un-checked-children="关"
          default-checked
        />
      </a-form-model-item>
      <a-form-model-item label="延期理由" required>
        <a-textarea
          v-model="form.reasons"
          placeholder="请输入延期理由"
          :rows="8"
          style="height: 150px"
        />
      </a-form-model-item>
      <div class="form-footer">
        <a-button type="primary" @click="submit">确定</a-button>
        <a-button style="margin-left: 10px" @click="close"> 取消 </a-button>
      </div>
    </a-form-model>
  </a-modal>
</template>

<script>
export default {
  props: {
    extensionVisible: {
      type: Boolean,
      default: false
    },
    //关闭弹框
    closeFunc: {
      type: Function,
      default: () => {}
    }
  },
  data() {
    return {
      formLayout: {
        labelCol: { span: 6 },
        wrapperCol: { span: 18 }
      },
      form: {
        date: '2021-06-10',
        messageAlert: false,
        extensionDate: '',
        reasons: ''
      }
    }
  },
  methods: {
    //关闭弹框
    close() {
      this.$emit('closeFunc')
    },
    submit() {
      this.$emit('closeFunc')
    }
  }
}
</script>
<style lang="less" scoped>
.approval-content {
  max-height: 580px;
  overflow-y: auto;
}
/deep/ .ant-select {
  color: #333;
  box-sizing: border-box;
  height: 40px;
  line-height: 40px;
}
/deep/ .ant-select-selection {
  border-radius: 2px;
  height: 40px;
}
/deep/ .ant-select-selection__rendered {
  line-height: 38px;
}
</style>

